RDK-61784: Handle device type RFC after xconf sync - #219
Open
NareshM1702 wants to merge 2 commits into
Open
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates RFC Manager’s Xconf response processing to react to changes in the DeviceType TR-181 parameter after an Xconf sync, with the intent of aligning dropbear’s runtime state with the new device type.
Changes:
- Add handling in
processXconfResponseConfigDataPart()to detect DeviceType updates (PROD builds) and conditionally restartdropbear.servicebased on whether dropbear is running with-f. - Introduce a new TR-181 key constant for DeviceType in
rfc_mgr_key.h.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
rfcMgr/rfc_xconf_handler.cpp |
Adds DeviceType-change handling to check dropbear runtime flags and restart the service when needed. |
rfcMgr/rfc_mgr_key.h |
Adds a new macro for the DeviceType TR-181 key string. |
Comments suppressed due to low confidence (2)
rfcMgr/rfc_xconf_handler.cpp:2591
- DeviceType values are normalized/stored as lowercase (e.g., getDeviceTypeRFC() maps to "test"/"prod" and gtests write "test"/"prod"), but this new logic compares against uppercase "TEST"/"PROD". That makes the dropbear restart path never trigger when Xconf/TR181 uses lowercase values.
if (newValue == "TEST" && !dropbearHasF)
{
RDK_LOG(RDK_LOG_INFO, LOG_RFCMGR, "[%s:%d] DeviceType=TEST, restarting dropbear with -f\n", __FUNCTION__, __LINE__);
int svcRet = v_secure_system("systemctl restart dropbear.service");
if (svcRet != 0)
rfcMgr/rfc_xconf_handler.cpp:2577
- If v_secure_popen() fails, the code silently proceeds with dropbearHasF=false. This is inconsistent with other v_secure_popen() usages in this file (which log and return) and makes troubleshooting difficult.
FILE *checkFp = v_secure_popen("r", "ps w 2>/dev/null | grep '[d]ropbear'");
if (checkFp)
{
char checkBuf[512] = {0};
while (fgets(checkBuf, sizeof(checkBuf) - 1, checkFp))
Comment on lines
41
to
43
| #define TELEMETRY_CONFIG_URL "Device.DeviceInfo.X_RDKCENTRAL-COM_RFC.Feature.Telemetry.ConfigURL" | ||
| #define RFC_DEVICE_TYPE_KEY "Device.DeviceInfo.X_RDKCENTRAL-COM_RFC.Identity.DeviceType" | ||
| #define XCONF_SELECTOR_NAME "XconfSelector" |
Comment on lines
+2566
to
+2570
| if (_ebuild_type == ePROD) { | ||
| if(newKey == RFC_DEVICE_TYPE_KEY) | ||
| { | ||
| RDK_LOG(RDK_LOG_INFO, LOG_RFCMGR, "[%s:%d] DeviceType changed to '%s', checking dropbear -f state\n", __FUNCTION__, __LINE__, newValue.c_str()); | ||
|
|
Code Coverage Summary |
vbaska
reviewed
Jul 24, 2026
| } | ||
| std::string account_key_str = RFC_ACCOUNT_ID_KEY_STR; | ||
| if (_ebuild_type == ePROD) { | ||
| if(newKey == RFC_DEVICE_TYPE_KEY) |
There was a problem hiding this comment.
Check if this validation & restart can be moved somewhere else in CPC.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.